<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>[%$softtitle%]</title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<link href="templates/css/formdiv.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript" src="../public/tinyMCE/jquery.tinymce.js"></script>
<script type="text/javascript" src="js/initedit.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	};

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodybottonauto")){
			$('.managebottonadd').css({height:h-40});
		}
	}
	var formmessmain_js_content_mess  = "[%$ST.formmessmain_js_content_mess%]";
	var formmessmain_js_add_ok = "[%$ST.formmessmain_js_add_ok%]";
	var formmessmain_js_add_ok = "[%$ST.formmessmain_js_add_ok%]";
	var iframename = "[%$iframename%]";
	$(document).ready(function(){
		var h = '[%$iframeheightwindow%]';
		$('.managebottonadd').css({height:h-40});
		editsimpleshow_height("#content");
		var options = {
			beforeSubmit: formverify,
			success:saveResponse,
			resetForm: false
		};
		$('#formmessedit').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	});




	function formverify(formData) {
		for (var i=0; i< formData.length; i++){
			if (formData[i].name == "content"){
				formData[i].value=tinyMCE.get('content').getContent();
			}
		}
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['content']=='') {
			document.formmessedit.content.focus();
			alert(formmessmain_js_content_mess);
			return false;
		}
		parent.windowsdig('Loading','iframe:index.php?archive=management&action=load','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			parent.frames[iframename].refresh('selectform','selectall','check_all');
			alert(formmessmain_js_add_ok);
		}else{
			alert(formmessmain_js_add_no);
		}
		parent.onaletdoc()
	}
</script>
</head>

<body>
<form name="formmessedit" id="formmessedit" method="post" action="index.php?archive=formmessmain&action=save">
<input type="hidden" name="inputclass" value="edit">
<input type="hidden" name="fvid" value="[%$read.fvid%]">
<input type="hidden" name="isreply" value="[%$read.isreply%]">
<input type="hidden" name="ismail" value="[%$form.ismail%]">
<div id="mainbodybottonauto" class="managebottonadd">
	<div class="maindobycontent">
		<div class="suggestion">
			<span class="sugicon"><span class="strong colorgorning2">[%$ST.position_title%]</span><span class="colorgorningage">[%$ST.formmessmain_type_add_mess%]</span></span>
		</div>
		<div class="manageeditdiv">
			<div class="maneditcontent">
				<table class="formtable">
					<tr>
						<td  class="trtitle03" colspan="2">[%$ST.formmessmain_type_add_typelngmode%]</td>
					</tr>
					[%forlist from=$attlist key=list%]
					[%if $attlist[list].isline!=1%]
					<tr class="trstyle2">
						<td class="trtitle01">[%$attlist[list].typename%]</td>
						<td class="trtitle02">
							[%if $attlist[list].inputtype=='select' || $attlist[list].inputtype=='radio' || $attlist[list].inputtype=='checkbox'%]
							[%forlist from=$attlist[list].attrvalue key=list2%]
							[%if $attlist[list].attrvalue[list2].selected=='selected'%][%$attlist[list].attrvalue[list2].name%][%/if%]
							[%/forlist%]
							[%elseif $attlist[list].inputtype=='datetime'%]
							[%$attlist[list].attrvalue|timeformat(3)%]
							[%else%]
							[%$attlist[list].attrvalue%]
							[%/if%]
						</td>
					</tr>
					[%/if%]
					[%/forlist%]
					<tr>
						<td  class="trtitle03" colspan="2">[%$ST.formmessmain_type_add_isreply%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.formmessmain_text_formgroupname%]</td>
						<td class="trtitle02">[%$form.formgroupname%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.formmessmain_text_addtime%]</td>
						<td class="trtitle02">[%$read.addtime|timeformat(3)%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.forummain_add_ip%]</td>
						<td class="trtitle02">[%$read.ipadd|ip(0)%]</td>
					</tr>
					[%if $docread.title!=''%]
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.formmessmain_type_doc%]</td>
						<td class="trtitle02"><a class="infolink02" target="_blank" href="[%$docread.readlink%]">[%$docread.title%]</a></td>
					</tr>
					[%/if%]
					[%if $memread.username!=''%]
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.formmessmain_type_member%]</td>
						<td class="trtitle02">[%$memread.username%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01"></td>
						<td class="trtitle02">ID=[%$memread.userid%]</td>
					</tr>
					[%/if%]
					[%if $read.isreply==0%]
					<tr class="trstyle2">
						<td class="trtitle011">[%$ST.formmessmain_type_mail%]</td>
						<td class="trtitle02">
							<input type="text" name="email" id="email" value="[%$sendmail%]" size="40" maxlength="50" class="infoInput"/>
						</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle011">[%$ST.formmessmain_type_add_isreply%]</td>
						<td class="trtitle02"><textarea name="content" id="content" style="width:98%;height:200px;" class="smallInput">[%$read.recontent%]</textarea></td>
					</tr>
					[%else%]
					[%if $form.ismail==1%]
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.formmessmain_type_retime%]</td>
						<td class="trtitle02">[%$read.retime|timeformat(3)%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.formmessmain_type_admin%]</td>
						<td class="trtitle02">[%$read.username%]</td>
					</tr>
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.formmessmain_type_add_isreply%]</td>
						<td class="trtitle02">[%$read.recontent%]</td>
					</tr>
					[%else%]
					<tr class="trstyle2">
						<td class="trtitle01">[%$ST.formmessmain_type_add_isreply%]</td>
						<td class="trtitle02">[%$ST.formmessmain_js_ismail_err%]</td>
					</tr>
					[%/if%]
					[%/if%]
				</table>
			</div>
		</div>
	</div>
</div>
<div id="downbotton">
	<div id="subbotton">
		<table border="0" width="100%">
			<tr>
				<td id="right"><input type="submit" id="messsubmitbotton" name="Submit" value="[%$ST.botton_remess%]" class="button orange" /></td>
				<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:parent.onaletdoc();" value="[%$ST.botton_remess_reset%]" class="button orange" /></td>
			</tr>
		</table>
	</div>
</div>
</form>
</body>

</html>